﻿var status = 0;
var eff1 = "#fUI/UIPVP.img/MiniMapIcon/star#";
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#";//"+ttt+"//美化1
var eff = "#fUI/UIWindow2.img/AttackRangking/1#";//小皇冠
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#";//小黄心
var 头顶 = "#fItem/Cash/0501.img/05010002/effect/default/7#";
var tz12 = "#fEffect/CharacterEff/1112924/0/0#";  //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#";  //蓝星
var tz14 = "#fEffect/CharacterEff/1112926/0/0#";  //红星
var 横条 = "#fEffect/SetEff.img/64/backgrnd/20";//雪人

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001 || cm.getMapId() == 910340000) {
        cm.sendOk("很遗憾，您因为在特殊地图无法使用此功能.")
        cm.dispose();
    } else if (status == 0) {
        var selStr = "               #e#rPPMS冒险岛·拓展功能" + "\r\n\r\n#e";
        selStr += "#L0#" + eff + " #b雇佣店铺#l  #L1#" + eff + " 仓库管理#l  #L2#" + eff + " 全品类抽奖#l\r\n\r\n";
        selStr += "#L3#" + eff + " #r宠物进化#l  #L4#" + eff + " 复活宠物#l  #L5#" + eff + " 清理背包#l\r\n\r\n";
        selStr += "#L6#" + eff + " #r金币兑换#l  #L7#" + eff + " 待定#l  #L8#" + eff + " 待定#l\r\n\r\n";
        cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
            case 0:
                cm.dispose();
                cm.openNpc(9030000);
                break;
            case 1:
                cm.dispose();
                cm.openNpc(9030100);
                break;
            case 2:
                cm.dispose();
                cm.openNpc(1540510, "全品类抽奖");
                break;
            case 3:
                cm.dispose();
                cm.openNpc(9090102, "神宠进化");
                break;
            case 4:
                cm.dispose();
                cm.openNpc(9090102, "复活宠物");
                break;
            case 5:
                cm.dispose();
                cm.openNpc(1012121, "Delete");
                break;
            case 6:
                cm.dispose();
                cm.openNpc(1012121, "金币兑换");
                break;
        }
    }
}
